package cn.dengta.webapp.risk.bean;

import javax.annotation.Nullable;

import lombok.Getter;
import org.apache.commons.lang3.EnumUtils;

/**
 * 风控等级
 *
 * @author XiaoRong
 * @since 2022-05-31
 */
@Getter
public enum RiskLevel {

	/** 通过 **/
	PASS(1),
	/** 可疑 **/
	REVIEW(2),
	/** 拦截 **/
	REJECT(3);

	public final Integer level;

	RiskLevel(Integer level) {
		this.level = level;
	}

	public static final RiskLevel[] CACHE = values();

	@Nullable
	public static RiskLevel of(@Nullable String name) {
		return EnumUtils.getEnum(RiskLevel.class, name, null);
	}

}
